Skip to content

fix(site,sanity): enable Sanity Presentation iframe preview and visual editing - #745

Merged
codercatdev merged 1 commit into
devfrom
fix/sanity-presentation-preview
Oct 16, 2026
Merged

codercatdev merged 1 commit into
devfrom
fix/sanity-presentation-preview

Conversation

@codercatdev

Copy link
Copy Markdown
Contributor

Summary

  • Allow https://*.sanity.studio and http://localhost:3333 in Content-Security-Policy: frame-ancestors and remove conflicting X-Frame-Options: SAMEORIGIN header in apps/site/src/middleware.ts
  • Support sanity-preview-pathname, sanity-preview-secret, and sanity-preview-perspective query params and set __sanity_preview with SameSite=None; Secure; Partitioned on HTTPS in /api/draft-mode/enable and /api/draft-mode/disable
  • Mount enableVisualEditing() from @sanity/visual-editing-standalone in DraftModeToggle.astro so Sanity Presentation completes its comlink handshake
  • Point PUBLIC_SANITY_STUDIO_URL to https://codingcat-prod.sanity.studio (prod) and https://codingcat-dev.sanity.studio (dev), and update localPreviewOrigin to http://localhost:4321

@github-actions

Copy link
Copy Markdown

⚡ Cloudflare Worker Preview Ready!

Environment URL
PR Preview https://40218be8-codingcatdev-dev.codingcatdev.workers.dev
Dev Custom Domain https://dev.codingcat.dev
  • Worker Version ID: 40218be8-cbf3-4af4-b1ba-c36d6639111f
  • Protection: Restricted to @codingcat.dev accounts via Cloudflare Zero Trust Access

@codercatdev
codercatdev merged commit 4ea5ab1 into dev Oct 16, 2026
4 checks passed
@codercatdev
codercatdev deleted the fix/sanity-presentation-preview branch October 16, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant